#ifndef CAMERAADJUST_H
#define CAMERAADJUST_H

#include <QWidget>
#include "appConfig.h"
#include <QButtonGroup>
#include <QSerialPort>
#include <QTimer>


namespace Ui {
class cameraAdjust;
}

class cameraAdjust : public QWidget
{
    Q_OBJECT

public:
    cameraAdjust(QWidget *parent = nullptr,QSerialPort * mPort = nullptr);
    ~cameraAdjust();

    QSerialPort * port = nullptr;

    QStringList listSpeed;
    QStringList listStatus;
    QButtonGroup * zoomBtGrop= nullptr;
    QButtonGroup * speedBtGrop= nullptr;
    QButtonGroup * zoomStyleGrop= nullptr;

    QWidget * meWidget = nullptr;

    QTimer * sliderTimer  = nullptr;

    void show(void){
        meWidget->show();
    }
    void hide(void){
         meWidget->hide();
    }
    uchar CheckXOR(uchar *data, int length)
    {
        uchar checksum = 0;
        for (int i = 0; i < length; i++) {
            checksum ^= data[i];
        }
        return checksum;
    }

    void sendInputZoom(uint32_t val);
    void sendInputFocus(uint32_t val);
signals:
    void WaitMs(int ms);

public slots:
    void updateSysData(void);
    void zoomBtGropClickedId(int id);
    void speedBtGropClickedId(int id);
    void zoomStyleGropClickedId(int id);
    void on_sliderTimer_timeout(void);

private slots:
    void on_pushButton_7_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_clicked(bool checked);

    void on_pushButton_2_clicked(bool checked);

    void on_pushButton_10_clicked();

    void on_pushButton_11_clicked();

    void on_lineEdit_returnPressed();

    void on_lineEdit_2_returnPressed();

    void on_lineEdit_8_returnPressed();

    void on_horizontalSlider_valueChanged(int value);

    void on_lineEdit_9_returnPressed();

private:
    Ui::cameraAdjust *ui;
};

#endif // CAMERAADJUST_H
